﻿using System.Collections.Generic;

namespace Ymatou.CommonService
{
    public class PagedList<T> : List<T>
    {
        public PagedList()
        {
        }

        public PagedList(int capacity)
            : base(capacity)
        {
        }

        public PagedList(IEnumerable<T> collection)
            : base(collection)
        {
        }

        public PagedList(IEnumerable<T> collection, int page, int pageSize, int recordCount)
            : this(collection)
        {
            this.PagerInfo = new PagerInfo(page, pageSize, recordCount);
        }

        int CurrentPage { get; set; }
        int AllPageCount { get; set; }
        private PagerInfo _pagerInfo;

        public PagerInfo PagerInfo
        {
            get { return new PagerInfo(_pagerInfo); }
            set { _pagerInfo = new PagerInfo(value); }
        }
    }
}